
<%@ page language="java" pageEncoding="UTF-8"%>

<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles"%>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html:html>
<link href="../css/style.css" rel="stylesheet" type="text/css">

<!-- ＝＝＝＝＝＝＝＝＝＝＝＝＝＝翻页控件开始（author:mxzhou createDate:2006-1-8）＝＝＝＝＝＝＝＝＝＝＝＝＝＝ -->

<TABLE border="0" cellpadding="0" cellspacing="3" width="100%">
	<TR>
		<TD id="turnPageTD" align="right" height="20" nowrap="nowrap">
			<DIV align="right">
				<html:hidden property="qinfo.currentPage"/>
				<html:hidden property="qinfo.totalPages"/>
			</DIV>
		</TD>
	</TR>
</TABLE>
<script language="JavaScript">
<!--

var intCurPage = document.forms[0].elements['qinfo.currentPage'].value*1;
var intTotalPages = document.forms[0].elements['qinfo.totalPages'].value*1;
var turnPageTD = document.getElementById("turnPageTD");

var ceiling;
if(intCurPage > 9)
	ceiling = intCurPage-9;
else
	ceiling = 1;

var floor;
if(intCurPage+9 > intTotalPages)
	floor = intTotalPages;
else
	floor = intCurPage+9;

if(intTotalPages != 1){

	if(intCurPage > 1)
	{
		turnPageTD.innerHTML += "<a href='javascript:pageGo(1)'>首页</a> ";
		turnPageTD.innerHTML += "<a href='javascript:pageGo("+eval(intCurPage-1)+")'>上一页</a> ";
	}
	
	for(i=ceiling;i<=floor;i++){
		if(i == intCurPage)
			turnPageTD.innerHTML += "<a href='javascript:pageGo("+i+")'>"+i+"</a> ";
		else
			turnPageTD.innerHTML += "<a href='javascript:pageGo("+i+")'>["+i+"]</a> ";
	}
	
	if(intCurPage < intTotalPages)
	{
		turnPageTD.innerHTML += "<a href='javascript:pageGo("+eval(intCurPage+1)+")'>下一页</a> ";
		turnPageTD.innerHTML += "<a href='javascript:pageGo("+intTotalPages+")'>末页</a> ";
	}

}
function pageGo(i)
{
	document.forms[0].elements["qinfo.currentPage"].value = i;
	document.forms[0].submit();
}

function pageFirst()
{

	if(intCurPage <= 1)
	{
		alert("已到首页！");
	}
	else
	{
		document.forms[0].elements["qinfo.currentPage"].value=1;
		document.forms[0].submit();
	}
}
function pagePrevious()
{

	if(intCurPage <= 1)
	{
		alert("已到首页！");
	}
	else
	{
		document.forms[0].elements["qinfo.currentPage"].value= intCurPage - 1;
		document.forms[0].submit();
	}

}
function pageNext()
{

	if(intCurPage >= intTotalPages)
	{
		alert("已到尾页！");
	}
	else
	{
		document.forms[0].elements["qinfo.currentPage"].value= intCurPage + 1;
		document.forms[0].submit();
	}
}
function pageEnd()
{

	if(intCurPage >= intTotalPages)
	{
		alert("已到尾页！");
	}
	else
	{
		document.forms[0].elements["qinfo.currentPage"].value=intTotalPages;
		document.forms[0].submit();
	}
}
//-->
</script>
</html:html>
